SELECT
<#assign prefixName=' '>
<#if (select__beginDate??)>
${prefixName} T.BEGIN_DATE AS beginDate
	<#assign prefixName=','>
</#if>
<#if (select__endDate??)>
${prefixName} T.END_DATE AS endDate
	<#assign prefixName=','>
</#if>
<#if (select__id??)>
${prefixName} T.ID AS id
	<#assign prefixName=','>
</#if>
<#if (select__orderCode??)>
${prefixName} T.ORDER_CODE AS orderCode
	<#assign prefixName=','>
</#if>
<#if (select__permissionId??)>
${prefixName} T.PERMISSION_ID AS permissionId
	<#assign prefixName=','>
</#if>
<#if (select__validateErrorId??)>
${prefixName} T.VALIDATE_ERROR_ID AS validateErrorId
	<#assign prefixName=','>
</#if>
<#if (select__validateRuleId??)>
${prefixName} T.VALIDATE_RULE_ID AS validateRuleId
	<#assign prefixName=','>
</#if>
<#if (select__validateSuccessId??)>
${prefixName} T.VALIDATE_SUCCESS_ID AS validateSuccessId
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.BEGIN_DATE AS beginDate
, T.END_DATE AS endDate
, T.ID AS id
, T.ORDER_CODE AS orderCode
, T.PERMISSION_ID AS permissionId
, T.VALIDATE_ERROR_ID AS validateErrorId
, T.VALIDATE_RULE_ID AS validateRuleId
, T.VALIDATE_SUCCESS_ID AS validateSuccessId
</#if>
FROM C1_PE_VA_RU_TRANSACT_MODE T
<#include "whereByCode.ftl">
<#assign prefixName='ORDER BY'>
<#if (order__by__beginDate??)>
${prefixName} T.BEGIN_DATE ${order__by__beginDate__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__endDate??)>
${prefixName} T.END_DATE ${order__by__endDate__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__id??)>
${prefixName} T.ID ${order__by__id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__orderCode??)>
${prefixName} T.ORDER_CODE ${order__by__orderCode__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__permissionId??)>
${prefixName} T.PERMISSION_ID ${order__by__permissionId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateErrorId??)>
${prefixName} T.VALIDATE_ERROR_ID ${order__by__validateErrorId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateRuleId??)>
${prefixName} T.VALIDATE_RULE_ID ${order__by__validateRuleId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateSuccessId??)>
${prefixName} T.VALIDATE_SUCCESS_ID ${order__by__validateSuccessId__value!}
	<#assign prefixName=','>
</#if>
